﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XLib.Node;

namespace NodeLib.Sample
{
    public class Data_Bool : NodeBase
    {
        public enum BoolEnum
        {
            True,
            False
        }

        public override void Init()
        {
            SetViewProperty(NodeColorSet.Data, "Variate", "布尔");

            PinGroupList.Add(new EnumDataPinGroup<BoolEnum>(this, PinGroupType.Data, "布尔")
            {
                Readable = true,
                Writeable = false
            });

            InitPinGroup();
        }

        public override string GetTypeString() => nameof(Data_Bool);

        public override Dictionary<string, object> GetParaDict()
        {
            Dictionary<string, object> result = new Dictionary<string, object>
            {
                { "Data", GetData(0) },
            };
            return result;
        }

        public override void LoadParaDict(string version, Dictionary<string, object> paraDict)
        {
            SetData(0, paraDict["Data"]);
        }

        protected override NodeBase CloneNode() => new Data_Bool();

        protected override void ExecuteNode()
        {
            Trace.WriteLine("执行布尔节点");
        }
    }
}
